<%@page import="fr.smile.liferay.portlet.news.service.NewsFlagLocalServiceUtil"%>
<%@page import="fr.smile.liferay.portlet.news.NoSuchFlagException"%>
<%@page import="com.liferay.portal.model.Role"%>
<%@page import="com.liferay.portal.service.UserGroupLocalServiceUtil"%>
<%@page import="com.liferay.portal.model.UserGroup"%>
<%@page import="com.liferay.portal.service.RoleLocalServiceUtil"%>
<%@page import="com.liferay.portal.service.OrganizationLocalServiceUtil"%>
<%@page import="com.liferay.portal.model.Organization"%>
<%@page import="com.liferay.portal.service.GroupLocalServiceUtil"%>
<%@page import="com.liferay.portal.model.Group"%>
<%@page import="com.liferay.portal.kernel.util.Validator"%>
<%@page import="javax.portlet.PortletURL"%>
<%@page import="com.liferay.portal.kernel.util.ParamUtil"%>
<%@page import="java.util.Map"%>
<%@page import="fr.smile.liferay.portlet.news.util.NewsUtil"%>
<%@page import="com.liferay.portlet.PortletURLUtil"%>
<%@page import="com.liferay.portal.kernel.util.HtmlUtil"%>
<%@page import="com.liferay.portal.kernel.util.StringPool"%>
<%@page import="fr.smile.liferay.portlet.news.service.NewsEntryLocalServiceUtil"%>
<%@page import="com.liferay.portal.kernel.dao.search.SearchContainer"%>
<%@page import="fr.smile.liferay.portlet.news.model.NewsEntry"%>
<%@page import="java.util.List"%>
<%@page import="com.liferay.portal.security.permission.ActionKeys"%>
<%@page import="fr.smile.liferay.portlet.news.model.NewsFlagConstants"%>
<%@page import="com.liferay.portal.kernel.util.StringUtil"%>
<%@page import="com.liferay.portal.kernel.util.GetterUtil"%>
<%@page import="com.liferay.portal.util.PortalUtil"%>
<%@page import="com.liferay.portal.kernel.dao.search.SearchEntry"%>
<%@page import="com.liferay.portal.kernel.util.FastDateFormatFactoryUtil"%>
<%@page import="java.text.Format"%>
<%@page import="com.liferay.portal.kernel.dao.search.ResultRow"%>
<%@page import="fr.smile.liferay.portlet.news.service.NewsEntryLocalServiceUtil"%>
<%@page import="com.liferay.portal.security.auth.PrincipalException"%>
<%@page import="fr.smile.liferay.portlet.news.service.NewsFlagLocalServiceUtil"%>

<%@ taglib uri="http://java.sun.com/portlet_2_0" prefix="portlet" %>
<%@ taglib uri="http://liferay.com/tld/ui" prefix="liferay-ui" %>
<%@ taglib uri="http://liferay.com/tld/security" prefix="liferay-security" %>
<%@ taglib uri="http://liferay.com/tld/theme" prefix="liferay-theme" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ taglib uri="http://liferay.com/tld/aui" prefix="aui" %>
<%@ taglib uri="http://liferay.com/tld/util" prefix="liferay-util" %>

<portlet:defineObjects />
<liferay-theme:defineObjects />

<%
themeDisplay.setIncludeServiceJs(true);
String tabs1 = ParamUtil.getString(request, "tabs1", "label.newsletters");

PortletURL portletURL = renderResponse.createRenderURL();
portletURL.setParameter("tabs1", tabs1);

String cmd = ParamUtil.getString(request, "cmd");
%>


<c:choose>
	<c:when test='<%= "preview".equals(cmd)%>'>
		<%@ include file="/html/portlet/newslist/preview_entry.jsp" %>
	</c:when>
	<c:when test='<%= "addEntry".equals(cmd) || request.getAttribute("NewsEntry") != null %>'>
		<%@ include file="/html/portlet/newslist/add_entry.jsp" %>
	</c:when>
	<c:otherwise>
		
		<liferay-util:include page="/html/portlet/newslist/tabs1.jsp" servletContext="<%=pageContext.getServletContext() %>"/>
		
		<c:choose>
			<c:when test='<%= tabs1.equals("label.newsletters") || request.getParameter("saveEntry")!=null%>'>
				<%@ include file="/html/portlet/newslist/view_entries.jspf" %>
			</c:when>
			<c:when test='<%= tabs1.equals("label.manage_newsletters") %>'>
				<%@ include file="/html/portlet/newslist/view_manage_entries.jspf" %>
			</c:when>
		</c:choose>
		
	</c:otherwise>
</c:choose>
